package com.lyf.boot.modules.system.entity.dto;

import com.lyf.boot.base.system.entity.SysConfig;
import com.lyf.boot.validate.group.AddGroup;
import com.lyf.boot.validate.group.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author Luyufan
 * @date 2023/8/16 10:03
 */
@Data
@AutoMapper(target = SysConfig.class)
public class SysConfigDto implements Serializable {

    @Serial
    private static final long serialVersionUID = 1730826609906894316L;

    /**
     * 配置id
     */
    @NotNull(message = "配置id不能为空", groups = {EditGroup.class})
    private Long configId;

    /**
     * 配置名称
     */
    @NotNull(message = "配置名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String configName;

    /**
     * 配置key
     */
    @NotNull(message = "配置key不能为空", groups = {AddGroup.class, EditGroup.class})
    private String configKey;

    /**
     * 配置值
     */
    @NotNull(message = "配置值不能为空", groups = {AddGroup.class, EditGroup.class})
    private String configValue;

    /**
     * 配置类型：是否内置
     */
    @NotBlank(message = "是否内置不能为空", groups = {AddGroup.class, EditGroup.class})
    @Pattern(regexp = "[YN]", message = "是否内置只能是Y或N", groups = {AddGroup.class, EditGroup.class})
    private String configType;

    /**
     * 备注
     */
    private String remark;
}
